import api from "@/util/api";

const userApi = {
  findAll(pageNum, size, params = {}) {
    return api
      .get("/user", {
        //发送请求
        params: {
          pageNum,
          size,
          ...params,
        },
      })
      .then((resp) => resp.data);
  },
  removeAll(ids) {
    return api.delete("/user", { data: ids }).then((resp) => resp.data);
  },
  save(user) {
    return api.post("/user", user).then((resp) => resp.data);
  },
  update(user) {
    return api.put("/user", user).then((resp) => resp.data);
  },
  updataByState(user) {
    return api.put("/user/state", user).then((resp) => resp.data);
  }
};

export default userApi;
